package com.fjec.devops.controller;

import com.fjec.common.protocol.JsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fjec.devops.service.IStatMarketUserNumService;

import javax.annotation.Resource;

/**
 * <p>
 * 015.统计-市场板块注册用户数表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-09-18
 */
@RestController
@RequestMapping("/")
public class StatMarketUserNumController {

    @Resource
    private IStatMarketUserNumService service;

    /**
     * 统计各市场用户概况
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/y/stat/market/user/total")
    public JsonResult statMarketUserTotalNum() throws Exception {
        return service.statMarketUserTotalNum();
    }

    /**
     * 各市场用户类别
     *
     * @param markCode
     * @return
     * @throws Exception
     */
    @GetMapping("/y/stat/farmer/sorting/pkg/num")
    public JsonResult statFarmerSortingPkgUserNum(Integer markCode) {
        return service.statFarmerSortingPkgUserNum(15, markCode);
    }

    /**
     * 农资厂总数
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/y/stat/material/num")
    public JsonResult statMaterialUserNum() throws Exception {
        return service.statMaterialUserNum(15);
    }

    /**
     * 采购商总数
     *
     * @return
     * @throws Exception
     */
    @GetMapping("/y/stat/purchase/num")
    public JsonResult statPurchaseUserNum() throws Exception {
        return service.statPurchaseUserNum(15);
    }

    // 造测试数据
    @GetMapping("/y/market/user/fake/data")
    public JsonResult marketUserFakeData() throws Exception {
        System.out.println("创建market user num 假数据");
        return null;
    }
}
